package cn.fzkj.springboot.service;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.impl.AMQImpl;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = "yunnan.news")
public class RabbitMQService {

    /**
     * 会报错。因为从浏览器上的会带上请求头
     */

    @RabbitHandler
    public void recieve(String content){

        System.out.println("接收到消息===>"+content);
    }

}
